package com.yjha.huazhubusiness.controller;


import com.yjha.huazhubusiness.bean.TbUserInfo;
import com.yjha.huazhubusiness.service.TbUserInfoService;
import com.yjha.huazhubusiness.utils.PageUtils;
import com.yjha.huazhubusiness.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;



/**
 * 用户信息表
 *
 * @author æ­å°
 * @email 1971240051@qq.com
 * @date 2025-05-13 15:07:07
 * */
@RestController
@RequestMapping("/lzmarathonsys/tbuserinfo")
// @Api(tags = "用户信息表")
// @CrossOrigin
public class TbUserInfoController {
    @Autowired
    private TbUserInfoService tbUserInfoService;

    /**
     * 列表
     */
    @GetMapping("/list")
    // @ApiOperation("用户信息表列表")
    //@RequiresPermissions("lzmarathonsys:tbuserinfo:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = tbUserInfoService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @GetMapping("/info/{tbId}")
    // @ApiOperation("用户信息表信息")
    //@RequiresPermissions("lzmarathonsys:tbuserinfo:info")
    public R info(@PathVariable("tbId") Integer tbId){
		TbUserInfo tbUserInfo = tbUserInfoService.getById(tbId);

        return R.ok().put("tbUserInfo", tbUserInfo);
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    // @ApiOperation("用户信息表保存")
    //@RequiresPermissions("lzmarathonsys:tbuserinfo:save")
    public R save(@RequestBody TbUserInfo tbUserInfo){
		R r = tbUserInfoService.saveTbUserInfo(tbUserInfo);

        return r;
    }

    /**
     * 修改
     */
    @PostMapping("/update")
    // @ApiOperation("用户信息表修改")
    //@RequiresPermissions("lzmarathonsys:tbuserinfo:update")
    public R update(@RequestBody TbUserInfo tbUserInfo){
		tbUserInfoService.updateById(tbUserInfo);

        return R.ok();
    }

    /**
     * 删除
     */
    @GetMapping("/delete")
    // @ApiOperation("用户信息表删除")
    //@RequiresPermissions("lzmarathonsys:tbuserinfo:delete")
    public R delete(@RequestBody Integer[] tbIds){
		tbUserInfoService.removeByIds(Arrays.asList(tbIds));

        return R.ok();
    }

}
